export const fromConfigdetale = (that) => {
  return {
    fieldsConfig: [
      {
        name: "version",
        label: "版本号",
        type: "number",
        rules: [
          {
            required: true,
            message: "版本号不可为空，且需数字类型",
            trigger: "blur",
          },
          {
            type: "number",
            message: "版本号必须为数字",
            trigger: "blur",
          },
        ],
        fieldType: "TextInput",
      },
      {
        name: "filename",
        label: "上传APK",
        rules: "required",
        fieldType: "APKUpload",
        type: "apk", // 安装包文件
      },
      {
        name: "curNickName",
        label: "提示",
        type: "password",
        date: {
          text:
            "上传成功后，在版本管理列表栏右侧点击【推送更新】按钮即可将最新APK推送至设置进行版本更新。",
        },
        fieldType: "TextView",
      },
    ],
    buttons: {},
  };
};
export const equipColumn = (that) => {
  return [
    {
      type: "index",
      label: "序号",
      width: 90,
    },
    {
      prop: "sysversion",
      label: "当前版本号",
      showOverflowTooltip: true,
    },
    {
      prop: "sysapkname",
      label: "APK名称",
      showOverflowTooltip: true,
    },
    {
      prop: "sysupdatedate",
      label: "上传日期",
      showOverflowTooltip: true,
    },
    {
      prop: "sysserviceip",
      label: "服务器地址",
    },
    // {
    //   label: '操作',
    //   width: 120,
    //   fixed: 'right',
    //   render: (h, scope) => {
    //     return (
    //       <div>
    //         <el-button
    //           type="text"
    //           size="mini"
    //           onClick={() => {
    //             that.passAction(scope.row)
    //           }}
    //         >
    //           推送更新
    //         </el-button>
    //       </div>
    //     )
    //   }
    // }
  ];
};

export const column = (that) => {
  return [
    {
      type: "index",
      label: "序号",
      width: 90,
    },
    {
      prop: "equserno",
      label: "设备序号",
      showOverflowTooltip: true,
    },
    {
      prop: "equnetno",
      label: "入网编号",
      showOverflowTooltip: true,
    },
    {
      prop: "orgname",
      label: "所属陵园",
      showOverflowTooltip: true,
    },
    {
      prop: "equipaddress",
      label: "IP地址",
      showOverflowTooltip: true,
    },
    {
      prop: "equversion",
      label: "版本号",
    },
    {
      prop: "equversionupdatetime",
      label: "版本更新时间",
      showOverflowTooltip: true,
    },
    {
      prop: "equstatusname",
      label: "状态",
      showOverflowTooltip: true,
    },
    {
      label: "操作",
      width: 80,
      fixed: "right",
      render: (h, scope) => {
        return (
          <div>
            <el-button
              type="text"
              size="mini"
              onClick={() => {
                that.EnabledAction(scope.row);
              }}
            >
              删除
            </el-button>
          </div>
        );
      },
    },
  ];
};
